<!DOCTYPE html>
<html lang="zh-CN" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorator="layout/default">
<head>
    <meta charset="UTF-8">
    <title>菜单管理</title>

</head>
<body>
<div layout:fragment="content" th:remove="tag">

    <div class="row">
        <div class="col-md-12">
            <!-- BEGIN PAGE TITLE & BREADCRUMB-->
            <h3 class="page-title">
                菜单管理
                <small>维护系统菜单</small>
            </h3>
            <ul class="page-breadcrumb breadcrumb">
<!--                 <li class="btn-group"> -->
<!--                     <button type="button" class="btn blue dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" -->
<!--                             data-delay="1000" data-close-others="true"> -->
<!--                         <span>跳转</span> <i class="fa fa-angle-down"></i> -->
<!--                     </button> -->
<!--                     <ul class="dropdown-menu pull-right" role="menu"> -->
<!--                         <li><a th:href="@{/sys/menu}">菜单列表</a></li> -->
<!--                         <li><a th:href="@{/sys/menu/form}">菜单添加</a></li> -->
<!--                     </ul> -->
<!--                 </li> -->
                <li>
                    <i class="fa fa-home"></i>
                    <a th:href="@{/}">首页</a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="#">系统设置</a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li><a href="#">菜单管理</a></li>
            </ul>
            <!-- END PAGE TITLE & BREADCRUMB-->

        </div>
    </div>


    <div class="row">
        <div class="col-md-12">
            <!--BEGIN TABS-->
            <div class="tabbable tabbable-custom tabbable-full-width">
                <ul class="nav nav-tabs">
                    <li><a th:href="@{/sys/menu}">菜单列表</a></li>
                    <li class="active">
                        <a href="#menu_tab_1_2">
                            菜单添加
                        </a>
                    </li>
                </ul>
                <div class="tab-content">
                    <div class="tab-pane active" id="menu_tab_1_2">
                        <div class="portlet box blue">
                            <div class="portlet-title">
                                <div class="caption"><i class="fa fa-reorder"></i>
                                    <th:block th:text="${menu.id} == null ? '修改' : '添加'">查看</th:block>
                                    系统菜单
                                </div>
                            </div>

                            <div class="portlet-body form">
                                <!-- BEGIN FORM-->
                                <form id="menuEditForm" class="form-horizontal" th:object="${menu}"
                                      th:action="@{/sys/menu/save}" method="post">
                                    <input type="hidden" th:field="*{id}"/>

                                    <div class="form-body">
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">上级菜单</label>

                                            <div class="col-md-4">
                                                <div th:replace="fragments/tool :: treeSelect (id='parent',name='parent.id', labelName='parent.name', nameVal=*{parent.id}, labelVal=*{parent.name}, cssClass='', placeholder='', dialogTitle='选择菜单', remoteUrl='/sys/menu/treeData?test=1', always=true)"></div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">名称</label>

                                            <div class="col-md-4">
                                                <input type="text" class="form-control" th:field="*{name}"
                                                       maxlength="50" htmlEscape="false"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">链接</label>

                                            <div class="col-md-4">
                                                <input type="text" class="form-control" th:field="*{href}"
                                                       maxlength="200" htmlEscape="false"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">目标</label>

                                            <div class="col-md-4">
                                                <input type="text" class="form-control" th:field="*{target}"
                                                       maxlength="10" htmlEscape="false"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">图标</label>

                                            <div class="col-md-4">
                                                <input type="text" class="form-control" th:field="*{icon}"
                                                       maxlength="10" htmlEscape="false"/>
                                                <!--<tags:iconselect modalTitle="选择图标" id="icon" name="icon"  value="${menu.icon}"></tags:iconselect>-->
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">排序</label>

                                            <div class="col-md-4">
                                                <input type="text" class="form-control" th:field="*{sort}"
                                                       maxlength="10" htmlEscape="false"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">可见</label>

                                            <div class="col-md-4">
                                                <div class="radio-list">
                                                    <label class="radio-inline"
                                                           th:each="item,stat : ${@userMenus.getDictList('show_hide')}">
                                                        <input type="radio" name="isShow"
                                                               th:id="'optionsRadios'+${stat.index}"
                                                               th:value="${item.value}"
                                                               th:if="${#strings.equalsIgnoreCase(item.value, menu.isShow)}" checked>
                                                        <input type="radio" name="isShow"
                                                               th:id="'optionsRadios'+${stat.index}"
                                                               th:value="${item.value}"
                                                               th:unless="${#strings.equalsIgnoreCase(item.value, menu.isShow)}">
                                                        <th:block th:text="${item.label}">label</th:block>
                                                    </label>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">添加到顶部下拉菜单</label>

                                            <div class="col-md-4">
                                                <div class="radio-list">
                                                    <label class="radio-inline"
                                                           th:each="item,stat : ${@userMenus.getDictList('sys_shortcut_show')}" th:with="defaultChecked='checked'">
                                                        <input type="radio" name="shortcut"
                                                               th:id="'shortcut'+${stat.index}"
                                                               th:value="${item.value}"
                                                               th:if="${#strings.equalsIgnoreCase(item.value, menu.shortcut)}" checked>
                                                        <input type="radio" name="shortcut"
                                                               th:id="'shortcut'+${stat.index}"
                                                               th:value="${item.value}"
                                                               th:unless="${#strings.equalsIgnoreCase(item.value, menu.shortcut)}">
                                                        <th:block th:text="${item.label}">label</th:block>
                                                    </label>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group last">
                                            <label class="col-md-3 control-label">权限标识</label>

                                            <div class="col-md-4">
                                                <input type="text" class="form-control input-medium"
                                                       th:field="*{permission}" maxlength="100" htmlEscape="false"/>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-actions fluid">
                                        <div class="col-md-offset-3 col-md-4">
                                            <button type="submit" class="btn blue">保 存</button>
                                            <button type="button" class="btn default" onclick="history.go(-1)">返 回
                                            </button>
                                        </div>
                                    </div>
                                </form>
                                <!-- END FORM-->
                            </div>

                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>


</div>


</body>
</html>
